-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor roles #564
base: master
Are you sure you want to change the base?
Refactor roles #564
Conversation
Would it make more sense to change the role interfaces (Statocles::App, Statocles::Page, Statocles::Deploy) into abstract base classes with methods that are required to be overridden. If that change was made, then Statocles::App::Role::Store would become Statocles::App::HasStore or WithStore (a base class to inherit from), which would, I think, achieve what you're trying to do here (de-confusify all the things!) Otherwise, this seems to be substituting one arbitrary set of role naming conventions for another, but let me explain the conventions I'm using here to see if there are improvements we can make:
(That, and the more we could rely on Mojo::Base and the fewer Moo-specific features we use I think will be better for long-term performance reasons, except we do a lot of Type::Tiny coercions which are probably the bulk of the time we spend really and maybe I shouldn't be thinking about this when there are other fires to put out 😛) |
This changes all roles from being eg
Statocles::App
toStatocles::Role::App
.Reasoning: the thing I found most confusing when digging into the code previously was the module
Statocles::App::Role::Store
- now that it's renamed toStatocles::Role::App::Store
(and with the additional doc snippet saying it's effectively an extension ofStatocles::Role::App
), I find it far more comprehensible. Similarly, all other roles being calledStatocles::Role::*
is far more clear to my comprehension.